package adv3;

import adv2.Teacher;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class ListT3 {
    public static void main(String[] args) {
        List<Integer> data = new ArrayList<>();
        data.add(5);
        data.add(3);
        data.add(52);
        data.add(51);
        data.add(15);
        data.add(424);
        data.add(14);
        data.add(23);
        data.add(22);
        Collections.sort(data);//升序
        Collections.reverse(data);
        System.out.println("排序后："+data);
        List<Teacher> s=new ArrayList<>();
        s.add(new Teacher("老吴",22,"化学"));
        s.add(new Teacher("老张",23,"生物"));
        s.add(new Teacher("小李",42,"物理"));
        s.add(new Teacher("于七",29,"数学"));
        s.add(new Teacher("Lucy",39,"English"));

        Teacher max = Collections.max(s);
        System.out.println("最大是:"+max);
//        Collections.sort(s);
//        System.out.println("排序后：");
//        for(Teacher t:s)
//            System.out.println(t);
    }
}
